package cn.fanyamin.dao.ibatis;

import java.io.*;
import com.ibatis.common.resources.*;
import com.ibatis.sqlmap.client.*;

public class SqlMapConfig {
	private static final SqlMapClient sqlMap;
	static{
		try{
			String resource="cn/fanyamin/ibatis/SqlMapConfig.xml";
			Reader reader=Resources.getResourceAsReader(resource);
			sqlMap=SqlMapClientBuilder.buildSqlMapClient(reader);
		}catch(Exception e){
			e.printStackTrace();
			throw new RuntimeException("Error initializing MyAppSqlConfig class.Cause:"+e);
		}
	}
	
	public static SqlMapClient getSqlMapInstance()
	{
		return sqlMap;
	}
}